{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import tensorflow as tf\n",
    "import numpy as np\n",
    "import matplotlib.pyplot as plt\n",
    "%matplotlib inline"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "### Data simulation\n",
    "y = 1*x + 0 "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "x_data = np.linspace(0,10,20) + np.random.uniform(-1.5,1.5,20)\n",
    "y_data = np.linspace(0,10,20) + np.random.uniform(-1.5,1.5,20)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[<matplotlib.lines.Line2D at 0xb311a6a58>]"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAAD8CAYAAABn919SAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvOIA7rQAADypJREFUeJzt3WGsVGedx/HfDy6CVLQ13HZL6eX2RYN2MVt0QqtszCLdbJs2BRPT1NKma0x44arVmCC6JPuGF74wRpvdGEitNoHibrCNTW21ihoxaS69gAkFbDAVbqngnaYqrQm3Jfx9McNCr4U7M+ecOWee8/28Yebcw5z/SenvnnnO+T+PI0IAgME3q+wCAAD5INABIBEEOgAkgkAHgEQQ6ACQCAIdABJBoANAIgh0AEgEgQ4AiRjq58EWLlwYo6Oj/TwkAAy8vXv3vhIRwzPt19dAHx0d1fj4eD8PCQADz/axTvZjyAUAEkGgA0AiCHQASASBDgCJINABIBEEOgAUaPLUad215VlNvna68GMR6ABQoAd3HdFzR1/Vgz87UvixZnwO3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I+kJEnCq7nrzZvkPSZETsLbuWgg1J+qCkb0fEckl/VQW+ouepPYa8Rq1fXoskXWb73nKr6o9oPS5Y+iODgxroXU87MIhsz1ErzLdHxGNl11OQlZLutH1UraGzj9neVm5JhTgu6XhEnPuWtVOtgE/JLZJ+HxHNiHhT0mOSPlJyTUX6o+2rJan952TJ9QxsoCc/7YBtqzXeejgivlF2PUWJiK9ExOKIGFXrv+PPIyK5q7qIOCnpJdtL25tWSzpUYklFmJB0s+357X+/q5XYjd9pnpB0f/v1/ZJ+WGItkvow22IRajLtwEpJ90k6YPs37W1fbXfnYjB9TtL29kXIi5I+VXI9uYqIMds7Je1T6ymt/apgN2UvbO+Q9C+SFto+Lum/JH1N0v/Z/rSkY5LuKq/CFjpFASARgzrkAgCYhkAHgEQQ6ACQCAIdABJBoANAIgh0AEgEgQ4AiSDQASARfwPMoazCz/GeFQAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.plot(x_data, y_data, '*')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Initiallize w and b"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "w = np.random.uniform(-1,1)\n",
    "b = np.random.uniform(-1,1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0.7015595835039523 0.9884520548622662\n"
     ]
    }
   ],
   "source": [
    "print(w,b)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "w_tf = tf.Variable(w)\n",
    "b_tf = tf.Variable(b)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Define error"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [],
   "source": [
    "error = 0\n",
    "for x,y in zip(x_data,y_data):\n",
    "    error += (w_tf * x + b_tf - y)**2"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Optimizer"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [],
   "source": [
    "optimizer = tf.train.GradientDescentOptimizer(learning_rate=0.001)\n",
    "train = optimizer.minimize(error)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [],
   "source": [
    "init = tf.global_variables_initializer()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [],
   "source": [
    "train_steps = 10\n",
    "with tf.Session() as sess:\n",
    "    sess.run(init)\n",
    "    for step in range(train_steps):\n",
    "        sess.run(train)\n",
    "    w_final, b_final = sess.run([w_tf,b_tf])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [],
   "source": [
    "y_pred = w_final * x_data + b_final"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[<matplotlib.lines.Line2D at 0xb31991b70>]"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAAD8CAYAAABn919SAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvOIA7rQAAGXJJREFUeJzt3X9gVuV5//H3FRKIPwCrghAw4jrn7w40Ai1rJ7pNEQf4bUsRaq2KtFWstjpE8Vtloy3azlmmbeGrUiaIRUVbrFoFdaMdDQSwRWB+cRUCCgYHglUSA1z743kgP0wgyXPOc348n9c/5J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_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.plot(x_data, y_data, '*')\n",
    "plt.plot(x_data, y_pred)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python (spinningup)",
   "language": "python",
   "name": "spinningup"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.8"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
